﻿using FD.RemoteAssistant.Core;
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Text;

namespace FD.RemoteAssistant.Entities
{
    /*
     * CreatedOn: 2018-05-15
     * CreatedBy: Jackie Lee(天宇遊龍)
     */
    public class RemoteSetting : IRemoteSetting
    {
        [DataColumn(Text = "所属组", Width = 125, SortIndex = 2)]
        public string Group { get; set; }

        [DataColumn(Text = "名称", Width = 125, SortIndex = 0)]
        public string Name { get; set; }

        [DataColumn(Text = "服务器", Width = 125, IsRequired = true, ErrMessage = "用户名不能为空", SortIndex = 1)]
        public string Server { get; set; }

        [DataColumn(Text = "域", Width = 125, SortIndex = 3)]
        public string Domain { get; set; }

        [DataColumn(Text = "用户名", Width = 100, IsRequired = true, ErrMessage = "用户名不能为空", SortIndex = 4)]
        public string UserName { get; set; }

        [DataColumn(Text = "密码", Width = 100, DataColumnType = DataColumnType.Password, IsRequired = true, ErrMessage = "密码不能为空", SortIndex = 5)]
        public string Password { get; set; }

        /// <summary>
        /// 驱动器
        /// </summary>
        [DataColumn(Text = "驱动器", Width = 100, DataColumnType = DataColumnType.CheckBox, SortIndex = 6)]
        public bool RedirectDrives { get; set; }

        /// <summary>
        /// 打印机
        /// </summary>
        [DataColumn(Text = "打印机", Width = 100, DataColumnType = DataColumnType.CheckBox, SortIndex = 7)]
        public bool RedirectPrinters { get; set; }

        /// <summary>
        /// 剪粘板
        /// </summary>
        [DataColumn(Text = "剪粘板", Width = 100, DataColumnType = DataColumnType.CheckBox, SortIndex = 8)]
        public bool RedirectSmartCards { get; set; }

        /// <summary>
        /// 端口
        /// </summary>
        [DataColumn(Text = "端口", Width = 60, DataColumnType = DataColumnType.CheckBox, SortIndex = 9)]
        public bool RedirectPorts { get; set; }

        /// <summary>
        /// 是否可用
        /// </summary>
        [DataColumn(Text = "是否可用", Width = 60, DataColumnType = DataColumnType.CheckBox, SortIndex = 10)]
        public bool IsEnable { get; set; }

        /// <summary>
        /// 是否全屏模式
        /// </summary>
        [DataColumn(Text = "全屏模式", Width = 60, DataColumnType = DataColumnType.CheckBox, SortIndex = 11)]
        public bool IsFullscreen { get; set; }

        /// <summary>
        /// 连接到
        /// </summary>
        [DataColumn(Text = "操作", Width = 60, DataColumnType = DataColumnType.Button, SortIndex = 12)]
        public string ConnectTo { get; set; } = "连接";

        public IRemoteSetting Clone()
        {
            return new RemoteSetting
            {
                ConnectTo = ConnectTo,
                Domain = Domain,
                Group = Group,
                IsFullscreen = IsFullscreen,
                Name = Name,
                Password = Password,
                RedirectDrives = RedirectDrives,
                RedirectPorts = RedirectPorts,
                RedirectPrinters = RedirectPrinters,
                RedirectSmartCards = RedirectSmartCards,
                Server = Server,
                UserName = UserName,
                IsEnable = IsEnable
            };
        }
    }
}
